Previous Book Contents Book Index Next

Inside Macintosh: Mac OS 8 Toolbox Reference /
Chapter 2 - Control Manager Reference / Control Manager Types and Constants


Control Part Code Constants

CHANGED WITH THE APPEARANCE MANAGER

Constants of type ControlPartCode are returned in the parameter of FindControl to determine whether a mouse-down event occurred in an active control and, if so, which control.

IMPORTANT
FindControl does not usually return the kControlDisabledPart or kControlInactivePart part codes and never returns them with the standard controls. These are used with HiliteControl.
enum {                   
   kControlNoPart                 = 0,  
   kControlLabelPart              = 1,  
   kControlMenuPart               = 2,  
   kControlTrianglePart           = 4,
   kControlEditTextPart           = 5,
   kControlPicturePart            = 6,
   kControlIconPart               = 7,
   kControlClockPart              = 8,
   kControlButtonPart             = 10, 
   kControlCheckBoxPart           = 11, 
   kControlRadioButtonPart        = 12,  
   kControlUpButtonPart           = 20, 
   kControlDownButtonPart         = 21, 
   kControlPageUpPart             = 22, 
   kControlPageDownPart           = 23, 
   kControlListBoxPart            = 24,
   kControlListBoxDoubleClickPart = 25,
   kControlImageWellPart          = 26.
   kControlRadioGroupPart         = 27,
   kControlIndicatorPart          = 129,
   kControlDisabledPart           = 254,
   kControlInactivePart           = 255 
};
typedef SInt16 ControlPartCode; 

Constant descriptions

kControlNoPart
Event did not occur in any control. Also unhighlights any highlighted part of the control when passed to the HiliteControl function. For bevel buttons with a menu attached, this part code indicates that either the mouse was released outside the bevel button and menu or that the button was disabled.
kControlLabelPart
Event occurred in the label of a pop-up menu control.
kControlMenuPart
Event occurred in the menu of a pop-up menu control. For bevel buttons with a menu attached, this part code indicates that the event occurred in a menu item of the bevel button.
kControlTrianglePart
Event occurred in a disclosure triangle control.
kControlEditTextPart
Event occurred in an editable text control.
kControlPicturePart
Event occurred in a picture control.
kControlIconPart
Event occurred in an icon control.
kControlClockPart
Event occurred in a clock control.
kControlButtonPart
Event occurred in either a push button or bevel button control. For bevel buttons with a menu attached, this part code indicates that the event occurred in the button but not in the attached menu.
kControlCheckBoxPart
Event occurred in a checkbox control.
kControlRadioButtonPart
Event occurred in a radio button control.
kControlUpButtonPart
Event occurred in the up button of a scroll bar control (the arrow at the top or the left).
kControlDownButtonPart
Event occurred in the down button of a scroll bar control (the arrow at the right or the bottom).
kControlPageUpPart
Event occurred in the page-up part of a scroll bar control.
kControlPageDownPart
Event occurred in the page-down part of a scroll bar control.
kControlListBoxPart
Event occurred in a list box control.
kControlListBoxDoubleClickPart
Double-click occurred in a list box control.
kControlImageWellPart
Event occurred in an image well control.
kControlRadioGroupPart
Event occurred in a radio group control. This constant is only available with Appearance 1.0.1 and later.
kControlIndicatorPart
Event occurred in the scroll box of a scroll bar control.
kControlDisabledPart
Used with HiliteControl to disable the control.
kControlInactivePart
Used with HiliteControl to make the control inactive.
WHEN THE APPEARANCE MANAGER IS NOT AVAILABLE
Only the following part codes are supported:

   kControlNoPart          = 0,  
   kControlLabelPart       = 1,  
   kControlMenuPart        = 2,  
   kControlTrianglePart    = 4,
   kControlButtonPart      = 10, 
   kControlCheckBoxPart    = 11, 
   kControlRadioButtonPart = 12,  
   kControlUpButtonPart    = 20, 
   kControlDownButtonPart  = 21, 
   kControlPageUpPart      = 22, 
   kControlPageDownPart    = 23, 
   kControlIndicatorPart   = 129,
   kControlDisabledPart    = 254,
   kControlInactivePart    = 255 

Previous Book Contents Book Index Next

© Apple Computer, Inc.
8 JAN 1998